package com.kuang.base;

/**
 * @author wuJiaWei
 * @version 1.0
 * @date 2024/8/7
 * @time 14:26:47
 */

//逻辑运算符
public class Demo02 {
    public static void main(String[] args) {
        // 与或取反
        boolean a = true;
        boolean b = false;

        System.out.println("a &&b =" + (a && b));//逻辑与
        System.out.println("a || b =" + (a || b));//逻辑或
        System.out.println("!a =" + (!a));//取反

        //短路逻辑运算符
        int c = 5;
        boolean d = (c < 4) && (c++ < 4);
        System.out.println("d =" + d);
        System.out.println("c =" + c);
    }
}
